- Create the illusion of turning. Superimpose several bitmaps and show the final result.
- Load roll background. First find the correct bitmap. The hardcoded values are used as offsets between resource IDs.
if ( rollOffset < 0 )
bitmapH = DmGet1Resource( 'Tbmp', Bank0Bitmap + ( 100 * ( -rollOffset ) ) );
else if ( rollOffset > 0 )
bitmapH = DmGet1Resource( 'Tbmp', ( Bank0Bitmap + 50 ) + ( 100 * ( rollOffset ) ) );
// Set the draw window, copy the bitmap, etc. See previous slides.
- Figure out where to vertically position the "roll" bitmap. The value 80 is the center of the display. Oops, another bad assumption (screen size).
if ( rollOffset < 0 )
rollOffset = -rollOffset;
pitchOffset = 80 + gFlightData.pitch - ( rollOffset + 2 );
- Another Mac-like call: set a rectangle's coords.
if ( rollOffset < 4 )
RctSetRectangle( &r, 0, 0, 160, 4 );
else
RctSetRectangle( &r, 0, 0, 160, rollOffset + 2 );
- Copy between windows. Note that these are both offscreen.
WinCopyRectangle( gOffscreenBankWindow, gOffscreenDestWindow, &r, 0, pitchOffset, scrCopy );
- A real man would draw directly to the screen. Here are some ideas:
- The window pointer contains a pointer to its bitmap.
- Use the rowBytes to set yourself up in the correct rows. Calculate your own y-offset, and multiply by rowBytes to get to the correct pixel location in the bitmap.
- Change the value of that pixel. Color-depth will determine how you set the bits.